package com.genghis.ptas.scorm.service;

import com.genghis.core.page.entity.Page;
import com.genghis.core.page.entity.PageParameter;
import com.genghis.core.page.entity.Page;
import com.genghis.core.page.entity.PageParameter;
import com.genghis.ptas.scorm.entity.NodesInfo;
import com.genghis.ptas.scorm.entity.SCOInfo;
import com.genghis.ptas.scorm.entity.ScormInfo;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: genghis4
 * Date: 14-4-22
 * Time: 下午8:16
 * To change this template use File | Settings | File Templates.
 */
public interface UpScormService {
    String upScorm(HttpServletRequest request, CommonsMultipartFile upFile) throws ServletException, IOException;

    List<NodesInfo> analyzeIms(String imsUrl) throws IOException;

    void addScorm(List<NodesInfo> nodesInfoList,String zipInfo,int userId,String imsUrl);

    ScormInfo findScormInfoById(int id);

    List<ScormInfo> findScormInfoPageList();

    void delCourse(String courseIds[]);

    void registScorm(int id,int userId);

    boolean isRegistScorm(int id,int userId);

    Page findUpFilePageList(PageParameter pageParameter, ScormInfo scormInfo, int userId);

    Page findCoursingPageListByUserId(PageParameter pageParameter, ScormInfo scormInfo, int userId);

    Page findCoursedPageListByUserId(PageParameter pageParameter, ScormInfo scormInfo, int userId);

    List<NodesInfo> listAllCourseByScormId(int scormId) throws IOException;

    List<NodesInfo> listAllCourseByScormId2(int scormId);

    void addSCOInfo(SCOInfo scoInfo);

    SCOInfo getSCOInfoByNodeIdAndStuId(SCOInfo scoInfo);

    void updateSCOInfoByNodeIdAndStuId(SCOInfo scoInfo);

    //是否学习过该课件，true学习过 false没有
    boolean isLearnedScorm(int scormId,int useId);

    //是否是学习完成的课件，true完成 false未完成
    boolean isCompletedScorm(int scormId,int userId);

    List<ScormInfo> listAllScormByUploadTime();

    List<ScormInfo> listAllScormByRegistNum();

    List<ScormInfo> listAllScormByAvgScore();

    List<ScormInfo> listAllScormByCourseType(int courseType);

    Page findOnlinePageList(PageParameter pageParameter, ScormInfo scormInfo, int userId);

}
